<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:sf="http://www.springframework.org/tags/faces"
      xmlns:sec="http://www.spring4facelets.org/security/tags">
<head>
    <title>org.spring4facelets.security tests</title>
</head>
<body>
     <div style="margin-left:auto;margin-right:auto;width:700px">

        <h1>Authentication Examples:</h1>
        <sec:authentication var="auth">
            <div><b>Principal:</b> <span id="principal">${auth.principal}</span></div>
            <div><b>Role #1:</b> <span id="role1">${auth.authorities[0]}</span></div>
            <div><b>Role #2:</b> <span id="role2">${auth.authorities[1]}</span></div>
       </sec:authentication>

        <h1>Authorize Examples:</h1>
        <div id="ifAllGranted">
            <sec:authorize ifAllGranted="ROLE_USER,ROLE_SUPERVISOR">
                ifAllGranted
            </sec:authorize>
        </div>
        <div id="ifAnyGranted">
            <sec:authorize ifAnyGranted="ROLE_USER,ROLE_SUPERVISOR">
                ifAnyGranted
            </sec:authorize>
        </div>
        <div id="ifNotGranted">
            <sec:authorize ifNotGranted="ROLE_USER,ROLE_SUPERVISOR">
                ifNotGranted
            </sec:authorize>
        </div>
    </div>
</body>
</html>